"use strict";
/**
 * 类类型：{new(构造函数形参): 类名}
 *
 *
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var MCCTypeInstance = /** @class */ (function () {
    function MCCTypeInstance() {
    }
    MCCTypeInstance.prototype.initMCCType = function () {
        this.cctype1Class(CCType1);
        this.cctype2Class(CCType2);
        this.cctype4Class(CCType1Sub);
    };
    // 1.类类型形参：CCType1构造函数无形参
    MCCTypeInstance.prototype.cctype1Class = function (classType1) {
        new classType1().testType1();
    };
    // 2.类类型形参：CCType2构造函数带形参
    MCCTypeInstance.prototype.cctype2Class = function (classType2) {
        new classType2('cctype2Class').testType2();
    };
    // 3.返回类类型数组
    MCCTypeInstance.prototype.cctype3Class = function () {
        return [CCType1];
    };
    //4.子类 类类型 赋值给父类
    MCCTypeInstance.prototype.cctype4Class = function (classType1) {
        new classType1().testFunc(); //调用子类方法
    };
    MCCTypeInstance.Instance = new MCCTypeInstance();
    return MCCTypeInstance;
}());
exports.MCCTypeInstance = MCCTypeInstance;
var CCType1 = /** @class */ (function () {
    function CCType1() {
        console.log('CCType1 构造函数');
    }
    CCType1.prototype.testType1 = function () {
        console.log('CCType1 testType1');
    };
    CCType1.prototype.testFunc = function () {
        console.log('父类CCType1 testFunc');
    };
    return CCType1;
}());
;
var CCType2 = /** @class */ (function () {
    function CCType2(name2) {
        console.log('CCType2 构造函数:' + name2);
    }
    CCType2.prototype.testType2 = function () {
        console.log('CCType2 testType2');
    };
    return CCType2;
}());
;
var CCType1Sub = /** @class */ (function (_super) {
    __extends(CCType1Sub, _super);
    function CCType1Sub() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    CCType1Sub.prototype.testFunc = function () {
        console.log('子类CCType1Sub testFunc');
    };
    return CCType1Sub;
}(CCType1));
exports.MCCType = MCCTypeInstance.Instance;
